package com.hanxin.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hanxin.pojo.TAudit;
import com.hanxin.pojo.Twoindex;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AppealMapper extends BaseMapper<TAudit> {
    @Select("select id,unit, requestcause, applynum, auditopinion, auditnum, auditstate,appealtype,attachment,year," +
            "attachmenturl from t_audit where year = #{year} and unit = #{unit} and auditstate = #{auditstate} and " +
            "pointid = #{pointid} and grade = #{grade}")
    IPage<TAudit> getByInformation(Page<TAudit> page,
                                   @Param("year") Integer year, @Param("unit") String unit,
                                   @Param("auditstate") String auditstate, @Param("pointid") Integer pointid,
                                   @Param("grade") Integer grade);
    @Select("select id,unit, requestcause, applynum, auditopinion, auditnum, auditstate,appealtype,attachment,year," +
            "attachmenturl from t_audit where year = #{year} and unit = #{unit} and auditstate = #{auditstate} and " +
            "pointid = #{pointid} and grade = #{grade}")
    List<TAudit> getByInformation1(@Param("year") Integer year, @Param("unit") String unit,
                                   @Param("auditstate") String auditstate, @Param("pointid") Integer pointid,
                                   @Param("grade") Integer grade);


}
